Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat: Issue link on create #613

Merged
merged 3 commits into from
Feb 19, 2021
Merged

Conversation

zemzale
Copy link
Collaborator

@zemzale zemzale commented Feb 10, 2021

Description

  • Add create LinkIssues api functino
  • Add issue linking option

Related Issue
Resolves #351

How Has This Been Tested?
Worked on my testing repo

Screenshots (if appropriate):
image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)

@zemzale
Copy link
Collaborator Author

zemzale commented Feb 10, 2021

I forgot to change the tests, don't mind the PR till then.

@codecov
Copy link

codecov bot commented Feb 13, 2021

Codecov Report

Merging #613 (293cce8) into trunk (2dc1ebb) will decrease coverage by 0.05%.
The diff coverage is 27.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #613      +/-   ##
==========================================
- Coverage   60.49%   60.43%   -0.06%     
==========================================
  Files          90       90              
  Lines        6348     6364      +16     
==========================================
+ Hits         3840     3846       +6     
- Misses       2147     2156       +9     
- Partials      361      362       +1     
Impacted Files Coverage Δ
commands/issue/create/issue_create.go 32.12% <27.27%> (-0.58%) ⬇️
internal/glrepo/repo.go 95.04% <0.00%> (-1.80%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dc1ebb...293cce8. Read the comment docs.

@zemzale
Copy link
Collaborator Author

zemzale commented Feb 13, 2021

FIxed the tests, but code coverage drops, down because I added issue linking.
I am not sure what is the best approach for adding tests for that.

Copy link
Owner

@profclems profclems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

Do you think we should consider the link_type since the API allows that?
According the API docs, the link_type defines the type of the relation and has 3 options: “relates_to”, “blocks”, “is_blocked_by”. The default is relates_to.

So here is my suggestion:
We should have a --link-type flag that can only be used together with --linked-issues flag to define the type of relation. But the default will be relates_to

ref: https://docs.gitlab.com/ee/api/issue_links.html#create-an-issue-link

@profclems profclems added cmd: issue Related to issues management enhancement New feature or request labels Feb 14, 2021
@zemzale
Copy link
Collaborator Author

zemzale commented Feb 18, 2021

With the last commit I added the link-type flag. Note that any other type then relates_to is not gonna work unless you are on starter|bronze plan, but you are just gonna get an error

POST https://gitlab.com/api/v4/projects/zemzale/test/issues/33/links: 403 {message: Blocked issues not available for current license}

@profclems
Copy link
Owner

With the last commit I added the link-type flag. Note that any other type then relates_to is not gonna work unless you are on starter|bronze plan, but you are just gonna get an error

POST https://gitlab.com/api/v4/projects/zemzale/test/issues/33/links: 403 {message: Blocked issues not available for current license}

Noted. I think the error message is self-explanatory

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cmd: issue Related to issues management enhancement New feature or request size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable issue linking for issue creation
2 participants